layui.use(['table', 'admin', 'ax','laydate','form'], function () {
    var $ = layui.$;


    // 搜索按钮点击事件
    $('#btnSearch').click(function () {

        var warehouseId = $("#storehouseId").val();
        if(warehouseId == ''){
            Feng.error("请选择仓库");
            return false;
        }
        var queryData = {};
        queryData['warehouseId'] = warehouseId;
        $.ajax({
            type: "POST",
            url: Feng.ctxPath + '/hxStoragePositionCx/listAll',
            dataType:'json',
            data: queryData,
            success: function (data) {
                var divContentObj = $("#divContent");
                // console.log(data)
                let str = "";
                data.forEach(row => {
                    str = str + '<div class="areaBox">';
                    row.forEach(column => {
                        str = str + '<div class="positionBox">';
                        str = str + column.positionNumber;
                        str = str + '</div>';
                    });
                    str = str + '</div>';
                });
                console.log(str)
                // 在元素的innerHTML属性中添加HTML代码
                divContentObj.html(str);
            },
            error: function (data) {
                console.log(data)
            },
            complete: function (data) {
            }
        });
    });

});